﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Styx.Helpers;
using System.IO;
using Styx;
using Styx.Common;
using System.ComponentModel;
using DefaultValue = Styx.Helpers.DefaultValueAttribute;
using Styx.TreeSharp;

namespace Kitty
{
    public class CRSettings : Settings
    {
        public static readonly CRSettings myPrefs = new CRSettings();

        public string SavePath = Path.Combine(Utilities.AssemblyDirectory, string.Format(@"Routines/Pasterke/Config/Druid/{0}/KittyFeralSettings-{1}.xml", StyxWoW.Me.RealmName, StyxWoW.Me.Name));

        public CRSettings()
            : base(Path.Combine(Utilities.AssemblyDirectory, string.Format(@"Routines/Pasterke/Config/Druid/{0}/KittyFeralSettings-{1}.xml", StyxWoW.Me.RealmName, StyxWoW.Me.Name)))
        {
        }

        public enum Keypress
        {
            None,
            LSHIFT,
            RSHIFT,
            LCTRL,
            RCTRL,
            LALT,
            RALT
        }

        [Setting]
        [DefaultValue(Keypress.None)]
        [Category("Extra's")]
        [DisplayName("Pause Key")]
        [Description("Set the key to pause the CR")]
        public Keypress PauseKeys { get; set; }

        [Setting]
        [DefaultValue(Keypress.None)]
        [Category("Extra's")]
        [DisplayName("Bear Form Key")]
        [Description("Set the key to switch to Bear Form")]
        public Keypress BearFormKeys { get; set; }

        [Setting]
        [DefaultValue(Keypress.None)]
        [Category("Extra's")]
        [DisplayName("Pause Aoe Key")]
        [Description("Set the key to pause Aoe")]
        public Keypress AoePauseKeys { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("Extra's")]
        [DisplayName("Raid Style Messages")]
        [Description("Set to true if you want Raid Style messages if the CR or Aoe is paused")]
        public bool PrintMsg { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("Cooldowns")]
        [DisplayName("Elites-Rares")]
        [Description("If (Target.Max.Health - My.Max.Health) >= Value, use Cooldowns")]
        public int ElitesHealth { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("Movement")]
        [DisplayName("Movement")]
        [Description("If you want auto movement or not")]
        public bool Movement { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("Movement")]
        [DisplayName("Targeting")]
        [Description("If you want auto targeting or not")]
        public bool Targeting { get; set; }

        [Setting]
        [DefaultValue(true)]
        [Category("Movement")]
        [DisplayName("Facing")]
        [Description("If you want auto facing or not")]
        public bool Facing { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Pull Settings")]
        [DisplayName("Prowl/Pounce")]
        [Description("Use Prowl/Pounce to pull")]
        public bool pounce { get; set; }

        [Setting]
        [DefaultValue(3)]
        [Category("Feral")]
        [DisplayName("Adds Aoe")]
        [Description("Number of adds to start Aoe")]
        public int StartCatAoe { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Glyphs")]
        [DisplayName("Glyph of Savagery")]
        [Description("If you have that Glyph or not")]
        public bool SavageryGlyph { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("Protection")]
        [DisplayName("Nature's Swiftness")]
        [Description("Use Healing touch if my Health % <= Value")]
        public int HealingTouchProc { get; set; }

        [Setting]
        [DefaultValue(65)]
        [Category("Protection")]
        [DisplayName("Cenarion Ward")]
        [Description("Use when health % <= Value, 0 to not use it.")]
        public int CenarionWard { get; set; }

        [Setting]
        [DefaultValue(70)]
        [Category("Protection")]
        [DisplayName("Barkskin")]
        [Description("Use when health % <= Value")]
        public int Barkskin { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Out of Combat")]
        [DisplayName("Healing Touch")]
        [Description("Use when health % <= Value")]
        public int HealingTouchOoc { get; set; }

        [Setting]
        [DefaultValue(85)]
        [Category("Out of Combat")]
        [DisplayName("Rejuvenation")]
        [Description("Use when health % <= Value")]
        public int RejuOoc { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Out of Combat")]
        [DisplayName("Prowl")]
        [Description("Use Prowl out of Combat")]
        public bool prowlOOC { get; set; }

        [Setting]
        [DefaultValue(5)]
        [Category("Feral")]
        [DisplayName("Switch Bear Form")]
        [Description("Number of adds to switch to Bear Form when not in Instances/Raids")]
        public int SwitchBear { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Feral")]
        [DisplayName("Shred")]
        [Description("If you want to use Shred in the rotation")]
        public bool shred { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Feral")]
        [DisplayName("Lifeblood")]
        [Description("If you are Herbalist and you want to use Lifeblood")]
        public CooldownPrefs lifeblood { get; set; }

        public enum CooldownPrefs
        {
            Never,
            OnCoolDown,
            Bosses
        }
        public enum PotionsPrefs
        {
            Manual,
            Bosses_Raid_Only,
            Bosses_All
        }

        [Setting]
        [DefaultValue(PotionsPrefs.Manual)]
        [Category("Cooldowns")]
        [DisplayName("Virmen Bite Potion")]
        [Description("When to use Virmen Bite potions. Will use it when Berserk is active. If you prepot, next use will be with Berserk active")]
        public PotionsPrefs virmenpotion { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Flasks")]
        [DisplayName("Flask of Spring Blossom")]
        [Description("Auto use in raids when enter Combat")]
        public bool useFlask { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Cooldowns")]
        [DisplayName("Trinket 1")]
        [Description("When to use the 1st Trinket")]
        public CooldownPrefs trinket1 { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Cooldowns")]
        [DisplayName("Trinket 2")]
        [Description("When to use the 2nd Trinket")]
        public CooldownPrefs trinket2 { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Cooldowns")]
        [DisplayName("Engineer Gloves")]
        [Description("When to use Engineer Gloves")]
        public CooldownPrefs gloves { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Cooldowns")]
        [DisplayName("Berserk")]
        [Description("When to use Berserk")]
        public CooldownPrefs useBerserk { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Cooldowns")]
        [DisplayName("Incarnation: King of the Jungle")]
        [Description("When to use Incarnation")]
        public CooldownPrefs useIncarnation { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Feral")]
        [DisplayName("Feral Spirit")]
        [Description("Auto use when you have Shaman Symbiosis")]
        public CooldownPrefs feralSpirit { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Feral")]
        [DisplayName("Shapeshift rooted")]
        [Description("Shapeshift if rooted, snared ....")]
        public bool changeForm { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Feral")]
        [DisplayName("Wild Charge")]
        [Description("Use Wild Charge to Pull or in Combat")]
        public bool wildCharge { get; set; }

        public enum CastMotW
        {
            Never,
            NotInParty,
            Always,
            AlwaysButNotInCombat
        }

        [Setting]
        [DefaultValue(CastMotW.Never)]
        [Category("Buffs")]
        [DisplayName("Mark of the Wild")]
        [Description("Use Wild Charge to Pull or in Combat")]
        public CastMotW motw { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Feral")]
        [DisplayName("Interrupt")]
        [Description("Auto interrupt spells")]
        public bool interrupt { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Cooldowns")]
        [DisplayName("Berserking")]
        [Description("When to use Berserking")]
        public CooldownPrefs berserking { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Flasks")]
        [DisplayName("Alchemy Flask")]
        [Description("Auto use Alchemy Flask if you are Alchemist and no bigger buff exists")]
        public bool AlchemyFlask { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Protection")]
        [DisplayName("Healthstone")]
        [Description("Use healthstone when health % <= Value")]
        public int healthstonepercent { get; set; }

        [Setting]
        [DefaultValue(25)]
        [Category("Protection")]
        [DisplayName("Might of Ursoc")]
        [Description("Use Might of Ursoc whan health % <= Value")]
        public int ursoc { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Protection")]
        [DisplayName("Survival Instincts")]
        [Description("Use Survival Instincts when health % <= Value")]
        public int survivalInstincts { get; set; }

        [Setting]
        [DefaultValue(CooldownPrefs.Never)]
        [Category("Protection")]
        [DisplayName("Nature's Vigil")]
        [Description("When to use Nature's Vigil")]
        public CooldownPrefs natureVigil { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Buffs")]
        [DisplayName("Predatory Swiftness")]
        [Description("Use Predatory Swiftness Procs to heal party members")]
        public bool predatoryHeal { get; set; }

        [Setting]
        [DefaultValue(80)]
        [Category("Buffs")]
        [DisplayName("Predatory Swiftness Health %")]
        [Description("Only heal others when my health % >= Value")]
        public int predatoryPercent { get; set; }

        [Setting]
        [DefaultValue(60)]
        [Category("Buffs")]
        [DisplayName("Predatory Swiftness Others %")]
        [Description("Only heal others when their health % <= Value")]
        public int otherPredatoryPercent { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Protection")]
        [DisplayName("Frenzied Regeneration")]
        [Description("Use Frenzied Regeneration when health % <= Value (Bear Form Only)")]
        public int frenzied { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Out of Combat")]
        [DisplayName("Eat food")]
        [Description("Eat food if health % <= Value")]
        public int food { get; set; }

        [Setting]
        [DefaultValue(45)]
        [Category("Protection")]
        [DisplayName("Renewal")]
        [Description("Use Renewal if health % <= Value")]
        public int renewal { get; set; }

        [Setting]
        [DefaultValue(false)]
        [Category("Glyphs")]
        [DisplayName("Glyph of Shred")]
        [Description("If you have it or not")]
        public bool ShredGlyph { get; set; }

    }
}

